-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option for running cmd_execute
in a subshell
#15540
Conversation
Are there scenarios we can think of where users wouldn't want to run this command in a subshell? |
Looks good, I can confirm this fixes sudo within Before fix
After fix:
|
I believe this particular command is one that doesn't work outside of a subshell |
I think users nearly always intend a command to be run in a subshell, however I can think of a few cases why they wouldn't want cmd_execute to default to a subshell:
I wonder if make sense to add a new option for a command that would be run under a subshell, e.g: |
@timwr thanks, those scenarios make sense.
Instead of a new command, what if we updated the |
@msjenkins-r7 test this please |
@msjenkins-r7 test this please. |
@smcintyre-r7 sorry but I'm not really sure I understand what the ask is here, since the |
I'm happy to land this as-is and make further changes in a new pull request. |
Release NotesThis adds an option to |
This PR adds the option to
cmd_execute
to have the command run in a subshell by meterpreterI've also updated the default switches for running a PTY to run in a subshell since it's currently required (except by the python meterpreter)
As a side effect of this running
shell -t
from a native linux meterpreter (mettle) now worksVerification steps
shell -t
sudo
should work)